package com.torlesse.authdemo.common.resp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: torlesse-liang
 * @Date: 2022/02/18/23:09
 * @Description:返回结果实体类
 */

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> implements Serializable {

    //是否成功
    private boolean flag;
    //返回码
    private Integer code;
    //返回消息
    private String message;
    //返回数据
    private T data;

    public Result(boolean flag, Integer code, String message){
        this.flag = flag;
        this.code = code;
        this.message = message;
    }
}
